/**
 * 
 */
package com.ctn.core.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Logger;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Zale
 *
 */
@Component
public class TCPServer {
	@Value("${tcp.server.port}")
	private int tcpPort;
	
	private static Logger logger = Logger.getLogger(TCPServer.class.getName());
	
	
	private void initDefault(){
		
	}
	@PostConstruct
	public void start(){
		initDefault();
		try {
			ServerSocket serverSocket=new ServerSocket(tcpPort);
			while(true){
				Socket socket=serverSocket.accept();
			}
		} catch (IOException e) {
			logger.warning(e.getMessage());
		}  

	}
}
